package com.qishi.annotation.aSimpleExample;

import org.springframework.aop.aspectj.annotation.AspectJProxyFactory;

public class AspectJProxyTest {


    public static void main(String[] args) {

        NaiveWaiter target = new NaiveWaiter();
        AspectJProxyFactory factory = new AspectJProxyFactory();

        //设置目标对象
        factory.setTarget(target);

        //设置切面
        factory.addAspect(PreGreetingAspect.class);

        //生成代理对象
        NaiveWaiter proxy = factory.getProxy();


        proxy.greetTo("John");
        proxy.serveTo("John");
    }



}
